import foundation
import json
import os

"""
该文件用来同步项目代码
"""

def a():
    foundation.util.git_clone()
    pass


class SourceCode:
    """源码配置"""
    project_dir = ""

    def __init__(self, remote_url, branch, item_name, **keywords):
        self.remote_url = remote_url
        self.branch = branch
        self.item_name = item_name
        self.keywords = keywords

    def get_git_path(self):
        return self.project_dir + "/" + self.item_name

    def sync_code(self):
        if os.path.exists(self.get_git_path()):
            foundation.util.git_pull(self.get_git_path())
        else:
            foundation.util.git_clone(self.get_git_path(), self.branch, self.remote_url, self.item_name)


class IPADownload:
    """ipa下载配置"""
    def __init__(self, manifest_url, **keywords):
        self.manifest_url = manifest_url

        pass


class AppItem:
    """App项目配置"""
    def __init__(self, app_name, source_code:[SourceCode], ipa_download:IPADownload):
        self.app_name = app_name
        self.source_code = source_code
        self.ipa_download = ipa_download



        pass



    # def __init__(self, app_name, app_version, **keywords):
    #     self.app_name = app_name
    #     self.app_version = app_version
    #     if "bundle_id" in keywords:
    #         self.bundle_id = keywords["bundle_id"]





if __name__ == "__main__":


    pass